package com.lamda.zhekou.dao.impl;

import com.lamda.zhekou.dao.ServerHostDao;
import com.lamda.zhekou.model.ServerHost;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by MJiao on 15/8/16.
 */
@Repository
public class ServerHostDaoImpl extends GenericDaoImpl<ServerHost> implements ServerHostDao {

    @Override
    public List<ServerHost> getHostsByFilter(String keyWord) {
        String qlString ="select e from ServerHost e where e.ip like :keyWord";
        return   this.entityManager.createQuery(qlString).setParameter("keyWord", "%" + keyWord + "%").getResultList();
    }
}
